<?php
/**
* @package   auto_occasion
* @subpackage entreprise
* @author    your name
* @copyright 2011 your name
* @link      http://www.yourwebsite.undefined
* @license    All rights reserved
*/

class regionListeZone extends jZone {
    protected $_tplname='regionListe.zone';

    protected function _prepareTpl(){
        
        jClasses::inc("entreprise~entrepriseSrv");

        $type = $this->param('type', 0);
        
        $entrepriseParType  = entrepriseSrv::listeByType($type);
        $departementId      = entrepriseSrv::getDepartementId($entrepriseParType);
        $region             = ($departementId) ? entrepriseSrv::getRegionByDepartement(implode(',', $departementId)) : array();
        $departement        = ($departementId) ? entrepriseSrv::getDepartement(implode(',', $departementId)) : array();

        $this->_tpl->assign('departementId', implode(',', $departementId));
        $this->_tpl->assign('region', $region);
        $this->_tpl->assign('departement', $departement);
    }
}
